<!DOCTYPE html>
<html lang="en">
   <head>
      <meta charset="utf-8">
      <title>w0923_3</title>
      <script>
         function show(){
            //div id가 "i1"인 요소내부에 = 입력받은 user명
            var n;
            n = document.getElementById("userName").value;
            document.getElementById("i1").innerHTML=n;
            alert(n)
         }
      </script>
   </head>

   <body>
      
         <form name="frm" id="frm" action="a.html" method="get">
            <input type="text" name="userName" id="userName"/>
            <input type="button" value="click" onclick="show()"/>
         </form>
    <div id="i1">
	</div>
      <script>
         document.write("<h2>입력</h2>");
         //var a = prompt('이름입력하세요','');
         //var a = confirm('수락하시겠습니까?');
         // 확인은 true, 취소는 false리턴
         
         var a = window.alert("나는 alert");
         document.write("변수값 :"+a);
      </script>
   </body>
</html>